package com.youchuang.redistest.common;

import java.io.Serializable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.hibernate.SessionFactory;

@SuppressWarnings("rawtypes")
public interface HibernateConnection<T> {
	
	public SessionFactory getSessionFactory();

	public Serializable save(T o);

	public void delete(T o);

	public void update(T o);

	public void saveOrUpdate(T o);

	public T get(String hql);

	public T get(String hql, Map<String, Object> params);

	public List<T> find(String hql);

	public List<T> find(String hql, Map<String, Object> params);

	public List<T> find(String hql, int first, int rows);

	public List<T> find(String hql, Map<String, Object> params, int first, int rows);

	public Iterator findGetIterator(String hql);

	public Iterator findGetIterator(String hql, Map<String, Object> params);

	public Iterator findGetIterator(String hql, int first, int rows);

	public Iterator findGetIterator(String hql, Map<String, Object> params, int first, int rows);

	public Long count(String hql);

	public Long count(String hql, Map<String, Object> params);

	public T get(Class<T> c, Serializable id);

	public int executeHql(String hql);
	
	public int executeHql(String hql, Map<String, Object> params);

}